package com.education.project.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.education.project.model.SysConfig;

public interface SysConfigMapper {
	@Select("select value from sys_config where name=#{value}")
	String getValue(String name);
	
	@Insert("insert into sys_config (name,value,description) values (#{name},#{value},#{description})")
	void save(SysConfig sysConfig);
	
	@Update("update sys_config set value=#{value},description=#{description} where name=#{name}")
	void update(SysConfig sysConfig);
	
	@Delete("delete from sys_config where name=#{value}")
	void delete(String name);
	
	@Select("select name,value,description from sys_config order by createtime")
	List<SysConfig> getall();
}
